package com.itheima.commons;

import com.itheima.commons.properties.*;
import com.itheima.commons.template.*;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 阿鹏
 * @date 2021/1/23 20:14
 */
@Configuration
@EnableConfigurationProperties({SmsProperties.class, OssProperties.class,
        AipFaceProperties.class, HuanXinProperties.class,
        ContentCensorProperties.class})
public class SmsTemplateAutoConfig {

    @Bean
    public SmsTemplate smsTemplate(SmsProperties smsProperties){
        return new SmsTemplate(smsProperties);
    }

    @Bean
    public OssTemplate ossTemplate(OssProperties ossProperties) {
        return new OssTemplate(ossProperties);
    }

    @Bean
    public AipFaceTemplate aipFaceTemplate(AipFaceProperties properties) {
        return new AipFaceTemplate(properties);
    }

    @Bean
    public HuanXinTemplate huanXinTemplate(HuanXinProperties properties) {
        return new HuanXinTemplate(properties);
    }

    @Bean
    public ContentCensorTemplate contentCensorTemplate(ContentCensorProperties properties) {
        return new ContentCensorTemplate(properties);
    }
}
